<template>
  <div></div>
</template>

<script>
export default {
  mounted () {
    var twoSum = function (nums, target) {
      for(let i=0;i<nums.length;i++){
        let index2 = nums.indexOf(target - nums[i])
        if (index2 != -1 && index2 != i) {
           return [i,index2]
        }
      }

    };
    let q = twoSum([2,7,11,15],9)
    console.log(q)
  },
  methods: {

  }
}
</script>

<style scoped>
</style>